﻿<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <link rel="stylesheet" type="text/css" media="all" href="~/assets/Moon/styles/Style.css" />
    <script type="text/javascript" src="~/assets/Moon/scripts/jQuery.js"></script>
    <script type="text/javascript" src="~/assets/shared/scripts/jquery.codecomb.fileupload.js"></script>
    <script type="text/javascript" src="~/assets/Moon/scripts/Main.js"></script>
    <script type="text/javascript" src="~/assets/Moon/scripts/highlight.js"></script>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>@ViewBag.Title - @ViewBag.Description</title>
</head>
<body>
    <div class="bg m">
        <div class="l"></div>
        <div class="c">
            <div class="cm"></div>
        </div>
        <div class="m"></div>
    </div>
    <div id="container">
        <div class="header m">
            <div class="search">
                <div id="search">
                    <input type="text" placeholder="搜索" maxlength="50" id="txtSearch" />
                    <input type="button" id="btnSearch" value="搜索" />
                </div>
            </div>
            <div class="nav">
                <ul>
                    <li id="p_home"><a href="~/">Home</a></li>
                    @foreach (CatalogViewModel x in ViewBag.Catalogs)
                    {
                        <li id="p_@x.Url.ToLower()">@Html.ActionLink(x.Title, "Catalog", "Home", new { id = x.Url }, "")</li>
                    }
                </ul>
            </div>
        </div>
        <div id="content">
            <script>window.enable_autoHighlight = '#main>.article';</script>
            <div id="main">
                @RenderBody()
            </div>
            <div id="sidebar">
                <div class="module widget_categories">
                    <div class="title">按分类</div>
                    <ul>
                        @foreach (CatalogViewModel x in ViewBag.Catalogs)
                        {
                            <li class='cat-item'>@Html.ActionLink(x.Title, "Catalog", "Home", new { id = x.Url }, null)  (@x.Count)</li>
                        }
                    </ul>
                </div>
                <div class="module widget_categories">
                    <div class="title">按月份</div>
                    <ul>
                        @foreach (CalendarViewModel x in ViewBag.Calendars)
                        {
                            <li class='cat-item'>@Html.ActionLink(x.Year + "年" + x.Month + "月", "Calendar", "Home", new { year = x.Year, month = x.Month }, null)  (@x.Count)</li>
                        }
                    </ul>
                </div>
                <div class="module widget_categories">
                    <div class="title">按标签</div>
                    <ul>
                        @foreach (TagViewModel x in ViewBag.Tags)
                        {
                            <li class='cat-item'>@Html.ActionLink(x.Title, "Tag", "Home", new { tag = x.Title }, null)  (@x.Count)</li>
                        }
                    </ul>
                </div>
                @*<div class="module widget_links">
                        <div class="title">友情链接</div>
                        <ul class='xoxo blogroll'>
                            @foreach (Link item in ViewBag.Links)
                            {
                                <li class='cat-item'><a href="@item.URL" target="_blank">@item.Title</a></li>
                            }
                        </ul>
                    </div>*@
                <div class="module widget_meta">
                    <div class="title">功能</div>
                    @if (Html.IsAdmin())
                    {
                        <form asp-action="PostNew" asp-controller="Admin" method="post" id="frmNewPost"></form>
                        <form asp-action="Logout" asp-controller="Admin" method="post" id="frmLogout"></form>
                    }
                    <ul>
                        @if (Html.IsAdmin())
                        {
                            <li>@Html.ActionLink("站点设置", "Index", "Admin", null, null)</li>
                            <li><a href="javascript:$('#frmNewPost').submit();">发表文章</a></li>
                            <li>@Html.ActionLink("分类管理", "Catalog", "Admin", null, null)</li>
                            <li><a href="javascript:$('#frmLogout').submit();">注销登录</a></li>
                        }
                        else
                        {
                            <li>@Html.ActionLink("登录", "Login", "Admin", null, null)</li>
                        }
                    </ul>
                </div>
                @if (Model != null && Model.GetType() != typeof(Post))
                {
                    <div class="module widget_meta sidebar-about">
                        <div class="title">关于我</div>
                        <div class="face"><img src="@ViewBag.AvatarUrl"></div>
                        <p style="text-align: center"><a href="@ViewBag.AboutUrl">@ViewBag.Site</a></p>
                    </div>

                    <div class="module widget_meta sidebar-about">
                        <div class="title">友情链接</div>
                        <div class="sidebar-blog-roll-outer">
                            @foreach (BlogRollViewModel x in ViewBag.Rolls)
                            {
                                <div class="sidebar-blog-roll"><a target="_blank" href="@x.URL"><img src="/file/download/@x.AvatarId" alt="@x.Name" /></a></div>
                            }
                            <div class="sidebar-blog-roll"><a href="javascript:BlogRoll('@ViewBag.GitHub');"><img src="~/assets/Default/images/blog-roll.png" /></a></div>
                            <div class="sidebar-blog-roll-tip"></div>
                        </div>
                    </div>
                }
            </div>
            <br clear="both" />
        </div>
    </div>
    <div class="footer m">
        <div class="content">
            Copyright(C) 2014-2015 <a href="http://www.1234.sh" class="profile">www.1234.sh</a>
            Template: 
            <select id="lstTemplate">
                @foreach (var t in Template.Collection.Templates)
                {
                    <!option @(Template.Current.Identifier == t.Identifier ? "selected" : "") value="@t.Identifier">@t.Title</!option>
                }
            </select>
        </div>
        <div class="engine">Powered by <a href="https://github.com/PomeloFoundation/YuukoBlog">YuukoBlog</a></div>
        <div class="back"><a href="#" rel="nofollow" title="Top">返回顶部</a></div>
    </div>
</body>
</html>
